<!doctype html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>EasyShare-个人信息</title>
    <link rel="icon" href="/favicon.ico" th:href="@{/favicon.ico}" sizes="32x32">
    <link href="/css/main/bootstrap.min.css" th:href="@{/css/main/bootstrap.min.css}" rel="stylesheet">
    <link href="/css/main/index-style.css" th:href="@{/css/main/index-style.css}" rel="stylesheet">
    <link href="/css/main/index-nprogress.css" th:href="@{/css/main/index-nprogress.css}" rel="stylesheet">
    <link href="/css/main/sidebar-canvi.css" th:href="@{/css/main/sidebar-canvi.css}" rel="stylesheet">
    <link href="/css/main/bootstrap-datetimepicker.min.css" th:href="@{/css/main/bootstrap-datetimepicker.min.css}"
          rel="stylesheet">
    <!--[if lt IE 9]>
    <script src="/js/main/html5shiv.min.js" type="text/javascript" th:href="@{/js/main/html5shiv.min.js}"></script>
    <script src="/js/main/respond.min.js" type="text/javascript" th:href="@{/js/main/respond.min.js}"></script>
    <script src="/js/main/selectivizr-min.js" type="text/javascript" th:href="@{/js/main/selectivizr-min.js}"></script>
    <![endif]-->
    <meta name="Keywords" content=""/>
    <meta name="description" content=""/>
    <script type="text/javascript">
        //判断浏览器是否支持HTML5
        // window.onload = function () {
        //     if (!window.applicationCache) {
        //         window.location.href = "/ie";
        //     }
        // }
    </script>
</head>
<!--这个页面没有登录是无法正常访问的-->
<body>
<!-- 模态框（Modal） -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"
     th:if="${visitor eq null}">
    <div class="modal-dialog">
        <div class="modal-content">
            <form action="/upload/userImg" method="post" enctype="multipart/form-data" id="imgSelect">
                <input type="hidden" name="uid" th:value="${session.user?.getUserid()}">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                        &times;
                    </button>
                    <h4 class="modal-title" id="myModalLabel">
                        选择你的新头像（小于10MB的图片格式文件）
                    </h4>
                </div>
                <div class="modal-body" style="height: 66px">
                    <div class="col-sm-6">
                        <div class="input-group">
                            <input id='location' class="form-control" onclick="$('#i-file').click();" readonly>
                            <label class="input-group-btn">
                                <input type="button" id="i-check" value="浏览文件" class="btn btn-primary"
                                       onclick="$('#i-file').click();">
                            </label>
                        </div>
                    </div>
                    <input type="file" name="file" id='i-file'
                           onchange="$('#location').val($('#i-file').val());" style="display: none">
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">关闭
                    </button>
                    <button type="submit" class="btn btn-primary">
                        提交
                    </button>
                </div>
            </form>
        </div><!-- /.modal-content -->
    </div><!-- /.modal -->
</div>
<div th:replace="~{commons/sidebar :: sidebar}"></div>
<section class="container user-select">
    <div th:replace="~{commons/leftbar :: leftbar}"></div>
    <!--/超小屏幕可见-->
    <div class="content-wrap"><!--内容-->
        <div class="content">
            <!--自己访问-->
            <div class="content-block contact-content" th:if="${visitor eq null}">
                <h2 class="title"><strong th:text="${session.user?.getUsername()}">UserName</strong></h2>
                <form action="/user/fix" method="post" class="form-horizontal"
                      style="position: relative;margin-top: 30px;margin-right: 60px;display: none"
                      id="userInfo">
                    <input type="hidden" name="userid" th:value="${session.user.getUserid()}">
                    <div class="form-group">
                        <label class="col-sm-2 control-label">昵称</label>
                        <div class="col-sm-10">
                            <input type="text" th:value="${session.user?.getUsername()}" name="username"
                                   class="form-control" placeholder="请输入昵称" maxlength="10">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">姓名</label>
                        <div class="col-sm-10">
                            <input type="text"
                                   th:value="${session.user.getUserrealname() eq null?'未填写':session.user.getUserrealname()}"
                                   name="userrealname" class="form-control" placeholder="请输入姓名" maxlength="10">
                        </div>
                    </div>
                    <div class="form-group" th:if="${session.user.getUsersex()==1||session.user.getUsersex() eq null}">
                        <label class="col-sm-2 control-label">性别</label>&nbsp;&nbsp;&nbsp;
                        <label class="radio-inline">
                            <input type="radio" name="usersex" id="optionsRadios3" value="1" checked>
                            男
                        </label>
                        <label class="radio-inline">
                            <input type="radio" name="usersex" id="optionsRadios4" value="0"> 女
                        </label>
                    </div>
                    <div class="form-group" th:if="${session.user.getUsersex()==0}">
                        <label class="col-sm-2 control-label">性别</label>&nbsp;&nbsp;&nbsp;
                        <label class="radio-inline">
                            <input type="radio" name="usersex" id="optionsRadios5" value="1">
                            男
                        </label>
                        <label class="radio-inline">
                            <input type="radio" name="usersex" id="optionsRadios6" value="0" checked>
                            女
                        </label>
                    </div>
                    <div class="form-group">
                        <label for="dtp_input2" class="col-md-2 control-label">生日</label>
                        <div class="input-group date form_date col-md-5" data-date="" data-date-format="yyyy-mm-dd"
                             data-link-field="dtp_input2" data-link-format="yyyy-mm-dd" style="padding-left: 15px">
                            <input class="form-control" size="16" type="text" value=""
                                   th:value="${#dates.format(session.user.getUserbirthday(),'yyyy-MM-dd')}"
                                   name="userbirthday" readonly>
                            <span class="input-group-addon"><span class="glyphicon glyphicon-remove"></span></span>
                            <span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span></span>
                        </div>
                        <input type="hidden" id="dtp_input2" value=""/><br/>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">个签</label>
                        <div class="col-sm-10">
                            <input type="text" name="userautograph" class="form-control" placeholder="请输入个签"
                                   th:value="${session.user.getUserautograph() eq null?'这个人很懒，你细品':session.user.getUserautograph()}"
                                   maxlength="10">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">邮箱</label>
                        <div class="col-sm-10">
                            <input type="text" name="useremail" class="form-control" placeholder="请输入邮箱"
                                   th:value="${session.user.getUseremail()}" maxlength="50">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">地址</label>
                        <div class="col-sm-10">
                            <input type="text" name="useraddress" class="form-control" placeholder="请输入地址"
                                   th:value="${session.user.getUseraddress() eq null?'未填写':session.user.getUseraddress()}"
                                   maxlength="255">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">手机</label>
                        <div class="col-sm-10">
                            <input type="text" name="userphone" class="form-control" placeholder="请输入手机"
                                   th:value="${session.user.getUserphone()==0?'00000000000':session.user.getUserphone()}"
                                   oninput="value=value.replace(/[^\d]/g,'')" maxlength="11">
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-sm-offset-2 col-sm-10">
                            <button type="submit" class="btn btn-default">修改</button>
                        </div>
                    </div>
                </form>
                <p style="margin: 25px auto"><span>头像：</span><a href="javascript:;" data-toggle="modal"
                                                                data-target="#myModal"><img
                        class="tou" alt="用户头像"
                        th:src="${session.user.getUserimg() eq null?'/img/main/pine-logo.jpg':session.user.getUserimg()}"
                        width="20%" height="20%"></a></a></p>
                <p><span>邮箱：</span><a th:href="'mailto:'+${session.user.getUseremail()}"
                                      th:text="${session.user.getUseremail()}">Email</a></p>
                <p><span>身份：</span><span th:if="${session.user.getUserlevel()==1}"><a
                        href="javascript:;">ES用户</a></span><span th:if="${session.user.getUserlevel()==2}"><a
                        href="javascript:;">EVIP</a></span><span th:if="${session.user.getUserlevel()==3}"><a
                        href="javascript:;">系统管理员</a></span>
                </p>
                <p><span>姓名：</span><a href="javascript:;"
                                      th:text="${session.user.getUserrealname() eq null?'未填写':session.user.getUserrealname()}">RealName</a>
                </p>
                <p><span>性别：</span><span th:if="${session.user.getUsersex()==1}"><a
                        href="javascript:;">男</a></span><span th:if="${session.user.getUsersex()==0}"><a
                        href="javascript:;">女</a></span><span th:if="${session.user.getUsersex() eq null}"><a
                        href="javascript:;">无法鉴定</a></span>
                </p>
                <p><span>年龄：</span><a href="javascript:;"
                                      th:text="${session.user.getUserage() eq null?'未填写':session.user.getUserage()}">Age</a>
                <p><span>个签：</span><a href="javascript:;"
                                      th:text="${session.user.getUserautograph() eq null?'这个人很懒，你细品':session.user.getUserautograph()}">Age</a>
                <p><span>星座：</span><a href="javascript:;"
                                      th:text="${session.user.getUserconstellation() eq null?'无结果，如有不周请联系站长QQ':session.user.getUserconstellation()}">Constellation</a>
                <p><span>地址：</span><a href="javascript:;"
                                      th:text="${session.user.getUseraddress() eq null?'未填写':session.user.getUseraddress()}">Address</a>
                <p><span>手机：</span><a href="javascript:;"
                                      th:text="${session.user.getUserphone()==0?'未填写':session.user.getUserphone()}">Phone</a>
                <p class="control"><span>操作：</span><a href="javascript:;" style="color: #319ACA"
                                                      id="fixInfo">修改资料</a>
                </p>
            </div>
            <!--访客访问-->
            <div class="content-block contact-content" th:if="${visitor==1}">
                <h2 class="title"><strong th:text="${user.getUsername()}">UserName</strong></h2>
                <p style="margin: 25px auto"><span>头像：</span><a href="javascript:;" data-toggle="modal"
                                                                data-target="#myModal"><img
                        class="tou" alt="用户头像"
                        th:src="${user.getUserimg() eq null?'/img/main/pine-logo.jpg':user.getUserimg()}"
                        width="20%" height="20%"></a></a></p>
                <p><span>邮箱：</span><a th:href="'mailto:'+${user.getUseremail()}"
                                      th:text="${user.getUseremail()}">Email</a></p>
                <p><span>身份：</span><span th:if="${user.getUserlevel()==1}"><a
                        href="javascript:;">ES用户</a></span><span th:if="${user.getUserlevel()==2}"><a
                        href="javascript:;">EVIP</a></span><span th:if="${user.getUserlevel()==3}"><a
                        href="javascript:;">系统管理员</a></span>
                </p>
                <p><span>姓名：</span><a href="javascript:;"
                                      th:text="${user.getUserrealname() eq null?'未填写':user.getUserrealname()}">RealName</a>
                </p>
                <p><span>性别：</span><span th:if="${user.getUsersex()==1}"><a
                        href="javascript:;">男</a></span><span th:if="${user.getUsersex()==0}"><a
                        href="javascript:;">女</a></span><span th:if="${user.getUsersex() eq null}"><a
                        href="javascript:;">无法鉴定</a></span>
                </p>
                <p><span>年龄：</span><a href="javascript:;"
                                      th:text="${user.getUserage() eq null?'未填写':user.getUserage()}">Age</a>
                <p><span>个签：</span><a href="javascript:;"
                                      th:text="${user.getUserautograph() eq null?'这个人很懒，你细品':user.getUserautograph()}">Age</a>
                <p><span>星座：</span><a href="javascript:;"
                                      th:text="${user.getUserconstellation() eq null?'无结果，如有不周请联系站长QQ':user.getUserconstellation()}">Constellation</a>
                <p><span>地址：</span><a href="javascript:;"
                                      th:text="${user.getUseraddress() eq null?'未填写':user.getUseraddress()}">Address</a>
                <p><span>手机：</span><a href="javascript:;"
                                      th:text="${user.getUserphone()==0?'未填写':user.getUserphone()}">Phone</a>
                </p>
            </div>
            <div class="content-block comment">
                <h2 class="title"><strong>添加留言</strong></h2>
                <form action="/lm/add" method="post" class="form-inline" id="comment-form">
                    <input type="hidden" name="lmto" th:if="${visitor eq null}" th:value="${session.user.getUserid()}">
                    <input type="hidden" name="lmto" th:if="${visitor==1}"
                           th:value="${user.getUserid() eq null?0:user.getUserid()}">
                    <div class="comment-form">
                        <textarea placeholder="在此处填写留言内容" name="lmmessage"></textarea>
                        <div class="comment-form-footer">
                            <div class="comment-form-text" th:if="${session.user ne null}"
                                 style="color: deepskyblue;font-weight: bolder">您将以<span
                                    style="color: green" th:text="${session.user.getUsername()}"></span>的身份进行提交
                            </div>
                            <div class="comment-form-text" th:if="${session.user eq null}"
                                 style="font-weight: bolder">
                                请先<a href="/page/toLogin" target="_self" style="color: #2c82c9"
                                     onmousemove="this.style='color:deepskyblue'"
                                     onmouseleave="this.style='color:#2c82c9'">登录</a>(登陆后才可以进行留言)
                            </div>
                            <div class="comment-form-btn" th:if="${session.user ne null}">
                                <button type="submit" class="btn btn-default btn-comment">提交留言</button>
                            </div>
                            <div class="comment-form-btn" th:if="${session.user eq null}">
                                <button type="button" class="btn btn-default btn-comment">提交留言</button>
                            </div>
                        </div>
                    </div>
                </form>
                <div class="content-block comment-content">
                    <h2 class="title"><strong>最新留言</strong></h2>
                    <ul th:if="${visitor eq null}">
                        <li th:each="lm:${session.LeavingMessages}"><span class="text"><strong
                                th:text="${lm.getCreateuname() eq '故乡忆旧梦'?'EasySharez站长':lm.getCreateuname()}">CreateUname</strong>&nbsp;(<span
                                th:text="${#dates.format(lm.getLmcreatetime(),'yyyy-MM-dd HH:mm:ss')}">CreateTime</span>) 留言：<br/>
                            <span th:text="${lm.getLmmessage()}">Message</span></span>
                        </li>
                    </ul>
                    <ul th:if="${visitor ne null}">
                        <li th:each="lm:${messages}"><span class="text"><strong
                                th:text="${lm.getCreateuname() eq '故乡忆旧梦'?'EasySharez站长':lm.getCreateuname()}">CreateUname</strong>&nbsp;(<span
                                th:text="${#dates.format(lm.getLmcreatetime(),'yyyy-MM-dd HH:mm:ss')}">CreateTime</span>) 留言：<br/>
                            <span th:text="${lm.getLmmessage()}">Message</span></span>
                        </li>
                    </ul>
                </div>
                <div class="content-block about-content">
                    <h2 class="title"><strong>关于EasyShare</strong></h2>
                    <p class="line-title">想要深入了解<span>EasyShare？</span></p>
                    <p>EasyShare的内容大概为网站前端和后端的技术，包括资源共享系统，资源是我平常收集的一些实用资源，也有其他网站转载过来的精品，如果我遇到好的资源会第一时间发布在本站内。</p>
                    <p>大家如果有好的文章好的技术请不要吝啬，欢迎前来投稿！</p>
                    <p>如果有什么疑问或者需要投稿的请使用下方联系方式，或者留言来告诉我，收到后第一时间回复。</p>
                </div>
                <div class="content-block contact-content">
                    <h2 class="title"><strong>站长信息</strong></h2>
                    <p><span>站长QQ：</span><a href="tencent://message/?uin=2638898550\">2638898550</a></p>
                    <p><span>站长信箱：</span><a href="mailto:13526160083@163.com">13526160083@163.com</a></p>
                    <p><span>交流群：</span><a href="#">暂无</a></p>
                </div>
            </div>
        </div>
    </div>
    <!--/内容-->
    <div th:replace="~{commons/rightbar :: rightbar}"></div>
    <!--/右侧>992px显示-->
    <footer th:replace="~{commons/footer :: footer}"></footer>
</section>
<div><a href="javascript:;" class="gotop" style="display:none;"></a></div>
<!--/返回顶部-->
<script src="js/jquery-3.1.1.min.js" type="text/javascript" th:src="@{/js/jquery-3.1.1.min.js}"></script>
<script src="js/main/bootstrap.min.js" type="text/javascript" th:src="@{/js/main/bootstrap.min.js}"></script>
<script src="js/main/nprogress.js" type="text/javascript" th:src="@{/js/main/nprogress.js}"></script>
<script src="js/main/index-code.js" type="text/javascript" th:src="@{/js/main/index-code.js}"></script>
<script src="js/main/bootstrap-datetimepicker.min.js" type="text/javascript"
        th:src="@{/js/main/bootstrap-datetimepicker.min.js}"></script>
<script src="js/main/bootstrap-datetimepicker.zh-CN.js" type="text/javascript"
        th:src="@{/js/main/bootstrap-datetimepicker.zh-CN.js}"></script>
<script type="text/javascript">
    $('.form_date').datetimepicker({
        language: 'zh-CN',
        weekStart: 1,
        todayBtn: 1,
        autoclose: 1,
        todayHighlight: 1,
        startView: 2,
        minView: 2,
        forceParse: 0
    });
</script>
</body>
</html>
